<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Bootstrap 实例 - 模态框（Modal）插件</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/js/foxit.ofd.ocx.new.js"></script>
    <script type="text/javascript">
        var obj;

        function fx_init() {
            var width = document.documentElement.clientWidth;
            var height = document.documentElement.clientHeight;
            obj = OFD.OCX.init("layui-fluid", width, height);
            obj.ready(obj._id);
            if (!("ActiveXObject" in window)) {
                obj.jsCallbackFun_InitSetting();
                obj.jsCallbackFun_UpdateInfo();
            }
            console.log("-------------------打开文件");
            obj.openFile("D:\\1.ofd", false);
        }

        function initSetting() {
            console.log("-------------------initSetting");
            obj.setCompositeVisible("Print", true);
        }
        //回调事件：包括翻页、打印、打印设置
        function UpdateInfo(strkey, strValue) {
            if (strkey == "GetCurPageIndex") {
                //var curPageIndex=obj.getCurPageIndex();
            } else if (strkey == "Print") {
                var log = obj.getLogFileContent();
            } else if (strkey == "PrintSetting") {
                alert(strValue);
            } else if (strkey == 'OpenfilePath') {
                //obj.showContextMenu(0);
                obj.showToolbar(0);
                obj.setViewPreference("Navigate", 1);
            } else if (strkey == 'SaveFileUp') {
                //保存文件成功后的回调操作
                //刷新页面等
            }
        }
    </script>
</head>
<body>

<h2>创建模态框（Modal）</h2>
<!-- 按钮触发模态框 -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
    开始演示模态框
</button>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    模态框（Modal）标题
                </h4>
            </div>
            <div class="modal-body">
                <button onclick="fx_init()">福昕插件</button>
                <div id="layui-fluid" class="layui-fluid" style="background-color: #00FF00;"></div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary">
                    提交更改
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>
</html>